import { _ as __nuxt_component_0 } from './nuxt-link-f57cd0d9.mjs';
import { _ as __nuxt_component_1 } from './client-only-7e9de0b5.mjs';
import { f as useRouter, u as useRuntimeConfig } from '../server.mjs';
import { defineComponent, ref, reactive, resolveComponent, resolveDirective, unref, withCtx, createTextVNode, mergeProps, createVNode, withKeys, useSSRContext } from 'vue';
import { u as useHead } from './composables-583e67d3.mjs';
import { u as useCookie } from './cookie-73492d56.mjs';
import { u as useCounter, b as get_message, c as c_message } from './counter-d2eb9e2d.mjs';
import { ssrRenderComponent, ssrRenderAttr, ssrRenderAttrs, ssrGetDirectiveProps, ssrRenderList, ssrRenderClass, ssrInterpolate } from 'vue/server-renderer';
import { ElMessage } from 'element-plus';
import hljs from 'highlight.js';
import markdownIt from 'markdown-it';
import 'ufo';
import 'ofetch';
import 'hookable';
import 'unctx';
import '@unhead/vue';
import '@unhead/dom';
import '@unhead/ssr';
import 'vue-router';
import 'h3';
import 'defu';
import '../../nitro/node-server.mjs';
import 'node-fetch-native/polyfill';
import 'node:http';
import 'node:https';
import 'destr';
import 'unenv/runtime/fetch/index';
import 'scule';
import 'ohash';
import 'unstorage';
import 'unstorage/drivers/overlay';
import 'unstorage/drivers/memory';
import 'radix3';
import 'node:fs';
import 'node:url';
import 'pathe';
import 'unified';
import 'mdast-util-to-string';
import 'micromark/lib/preprocess.js';
import 'micromark/lib/postprocess.js';
import 'unist-util-stringify-position';
import 'micromark-util-character';
import 'micromark-util-chunked';
import 'micromark-util-resolve-all';
import 'remark-emoji';
import 'rehype-slug';
import 'remark-squeeze-paragraphs';
import 'rehype-external-links';
import 'remark-gfm';
import 'rehype-sort-attribute-values';
import 'rehype-sort-attributes';
import 'rehype-raw';
import 'remark-mdc';
import 'remark-parse';
import 'remark-rehype';
import 'mdast-util-to-hast';
import 'detab';
import 'unist-builder';
import 'mdurl';
import 'slugify';
import 'unist-util-position';
import 'unist-util-visit';
import 'shiki-es';
import 'unenv/runtime/npm/consola';
import 'cookie-es';
import './asyncData-b7b62de5.mjs';

const _imports_0 = "";
const _imports_1 = "";
const _imports_2 = "";
const _imports_3 = "";
const _imports_4 = "";
const _imports_5 = "";
const _imports_6 = "";
const _imports_7 = "";
const _imports_8 = "";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  __ssrInlineRender: true,
  setup(__props) {
    const counter = useCounter();
    const renderMarkdown = (markdown) => {
      return markdownIt({
        highlight: (str, lang) => {
          if (lang && hljs.getLanguage(lang)) {
            try {
              return `<pre class="hljs"><span class="pre_copy">Copy</span><code>${hljs.highlight(str, {
                language: lang,
                ignoreIllegals: true
              }).value}</code></pre>`;
            } catch (__) {
            }
          }
          return `<pre class="hljs"><span class="pre_copy">Copy</span><code>${markdownIt().utils.escapeHtml(str)}</code></pre>`;
        },
        breaks: true
        // 添加breaks插件
      }).render(markdown);
    };
    useHead({
      title: counter.setting.title,
      meta: [{
        name: "description",
        content: counter.setting.description
      }, {
        name: "keywords",
        content: counter.setting.keywords
      }]
    });
    const token = useCookie("token");
    const router = useRouter();
    const messages = ref([]);
    const ms_active = ref(0);
    const me_message = ref([]);
    const loadins = ref(false);
    const send_loading = ref(false);
    const data_load = ref(true);
    const scene_model = ref([]);
    const m_last = ref({});
    const page = ref(1);
    const limit = ref(8);
    const ms_count = ref(0);
    const left_loding = ref(false);
    const all_message = () => {
      data_load.value = true;
      get_message({
        page,
        limit
      }).then((res) => {
        messages.value = res._rawValue.data;
        scene_model.value = res._rawValue.scene;
        m_last.value = res._rawValue.m_last;
        ms_count.value = res._rawValue.count;
        left_loding.value = false;
        data_load.value = false;
      }).catch((err) => {
        data_load.value = false;
        left_loding.value = false;
        console.log(err);
      });
    };
    all_message();
    const handleCurrentChange = (val) => {
      console.log(val);
      left_loding.value = true;
      get_message({
        page: val,
        limit
      }).then((res) => {
        page.value = val;
        messages.value = res._rawValue.data;
        ms_count.value = res._rawValue.count;
        left_loding.value = false;
      }).catch((err) => {
        left_loding.value = false;
        console.log(err);
      });
    };
    const check_message = (id) => {
      ms_active.value = id;
      loadins.value = true;
      c_message({
        session_id: id
      }).then((res) => {
        me_message.value = res._rawValue.data;
        loadins.value = false;
        down_message();
      }).catch((err) => {
        loadins.value = false;
      });
    };
    const down_message = () => {
      setTimeout(() => {
        let chat = document.getElementsByClassName("chat-content")[0];
        chat.style.transition = "500ms";
        chat.scrollTo({
          top: chat.scrollHeight,
          behavior: "smooth"
        });
      }, 100);
    };
    const ruleFormRef = ref();
    const ruleForm = reactive({
      message_input: ""
    });
    const rules = reactive({
      message_input: [{
        required: true,
        message: "\u8BF7\u8F93\u5165\u5185\u5BB9",
        trigger: "blur"
      }]
    });
    const {
      public: {
        baseUrl
      }
    } = useRuntimeConfig();
    const headers = {
      "Authorization": `Bearer ${token.value}`,
      "Accept": "text/event-stream"
    };
    const is_done = ref(true);
    const streams = ref();
    const submitForm = async (formEl) => {
      if (!formEl)
        return;
      await formEl.validate(async (valid, fields) => {
        var _a;
        if (valid) {
          if (!token.value) {
            ElMessage.warning("\u8BF7\u5148\u767B\u5F55");
            router.push({
              path: "/login"
            });
            return false;
          }
          send_loading.value = true;
          me_message.value.push({
            "session_id": ms_active.value,
            "question": ruleForm.message_input,
            "message": ""
          });
          down_message();
          const res = await fetch(`${baseUrl}api/send_bot`, {
            method: "POST",
            headers,
            body: JSON.stringify({
              info: ruleForm.message_input,
              session_id: ms_active.value
            })
          });
          console.log(res);
          if (res.status == 500) {
            send_loading.value = false;
            ElMessage.error("\u670D\u52A1\u5668\u9519\u8BEF");
            return false;
          }
          if (res.status == 401) {
            send_loading.value = false;
            ElMessage.error("\u7981\u6B62\u53D1\u9001\u8FDD\u7981\u8BCD");
            return false;
          }
          if (res.status == 402) {
            send_loading.value = false;
            ElMessage.error("\u53D1\u9001\u6B21\u6570\u4E0A\u7EBF\u6216\u4F59\u989D\u4E0D\u8DB3");
            return false;
          }
          const stream = (_a = res.body) == null ? void 0 : _a.getReader();
          const onData = ({
            value
          }) => {
            let result = new TextDecoder().decode(value);
            let arr = result.split("\n\n").map((str) => str.replace(/\n/g, ""));
            let new_arr = [];
            for (let i = 0; i < arr.length; i++) {
              is_done.value = false;
              if (arr[i].slice(-2) == "]}" && arr[i].startsWith("data:")) {
                new_arr.push(JSON.parse(arr[i].replace("data:", "")));
              } else if (arr[i].startsWith("data:") && arr[i].slice(-2) != "]}") {
                streams.value = arr[i].replace("data:", "");
              } else if (arr[i].slice(-2) == "]}" && arr[i].startsWith("data:") == false) {
                let str = streams.value += arr[i];
                new_arr.push(JSON.parse(str.replace("data:", "")));
                streams.value = "";
              } else {
                if (arr[i].includes('"error"')) {
                  me_message.value[me_message.value.length - 1].message = JSON.parse(arr[i]).error.message;
                }
                streams.value = "";
              }
            }
            for (let i = 0; i < new_arr.length; i++) {
              setTimeout(() => {
                if (new_arr[i].choices[0].delta.content) {
                  me_message.value[me_message.value.length - 1].message += new_arr[i].choices[0].delta.content;
                }
                down_message();
              }, 100);
            }
          };
          const read = async () => {
            const result = await (stream == null ? void 0 : stream.read());
            if (result == null ? void 0 : result.done) {
              console.log("done");
              is_done.value = true;
              send_loading.value = false;
              ruleForm.message_input = "";
              if (ms_active.value == 0) {
                all_message();
                setTimeout(() => {
                  if (ms_active.value == 0) {
                    ms_active.value = m_last.value.session_id;
                  }
                  check_message(ms_active.value);
                }, 2e3);
              }
            } else {
              send_loading.value = true;
              is_done.value = false;
              onData(result);
              await read();
            }
          };
          await read();
        } else {
          console.log("error submit!", fields);
        }
      });
    };
    const qs_input = ref("");
    const handleClick = (command) => {
      const input = document.createElement("input");
      input.setAttribute("readonly", "readonly");
      input.setAttribute("value", command.replace(/&nbsp;/g, " "));
      document.body.appendChild(input);
      input.select();
      if (document.execCommand("copy")) {
        document.execCommand("copy");
        ElMessage.success("\u590D\u5236\u6210\u529F");
      }
      document.body.removeChild(input);
    };
    ref();
    ref();
    ref(false);
    ref("ltr");
    return (_ctx, _push, _parent, _attrs) => {
      const _component_NuxtLink = __nuxt_component_0;
      const _component_el_skeleton = resolveComponent("el-skeleton");
      const _component_el_pagination = resolveComponent("el-pagination");
      const _component_client_only = __nuxt_component_1;
      const _component_el_dropdown = resolveComponent("el-dropdown");
      const _component_el_dropdown_menu = resolveComponent("el-dropdown-menu");
      const _component_el_dropdown_item = resolveComponent("el-dropdown-item");
      const _component_el_form = resolveComponent("el-form");
      const _component_el_form_item = resolveComponent("el-form-item");
      const _component_el_input = resolveComponent("el-input");
      const _component_el_button = resolveComponent("el-button");
      const _directive_loading = resolveDirective("loading");
      _push(`<!--[--><div class="sidebar border-end py-xl-4 py-3 px-xl-4 px-3"><div class="tab-content"><div class="tab-pane fade show active" id="nav-tab-chat" role="tabpanel"><div class="d-flex justify-content-between align-items-center mb-4"><h3 class="mb-0 text-primary">Chat</h3><div>`);
      if (!unref(token)) {
        _push(ssrRenderComponent(_component_NuxtLink, {
          to: "/login",
          class: "btn btn-primary"
        }, {
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(`\u2728 \u767B\u5F55!`);
            } else {
              return [createTextVNode("\u2728 \u767B\u5F55!")];
            }
          }),
          _: 1
        }, _parent));
      } else {
        _push(ssrRenderComponent(_component_NuxtLink, {
          to: "/users/setting",
          class: "btn btn-primary"
        }, {
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(`\u2728 \u4E2A\u4EBA\u4E2D\u5FC3`);
            } else {
              return [createTextVNode("\u2728 \u4E2A\u4EBA\u4E2D\u5FC3")];
            }
          }),
          _: 1
        }, _parent));
      }
      _push(`</div></div><div class="form-group input-group-lg search mb-3"><i class="zmdi zmdi-search"></i><i class="zmdi zmdi-dialpad"></i><input type="text" class="form-control"${ssrRenderAttr("value", qs_input.value)} placeholder="Search..."></div><ul class="chat-list"><li class="header d-flex justify-content-between ps-3 pe-3 mb-1"><span>RECENT CHATS</span><div class="dropdown"><a class="btn btn-link px-1 py-0 border-0 text-muted dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="zmdi zmdi-refresh"></i></a></div></li><li><div class="card"><div class="card-body"><div class="media"><div class="avatar me-3"><div class="avatar rounded-circle no-image bg-primary text-light"><span><i class="zmdi zmdi-comment-text"></i></span></div></div><div class="media-body overflow-hidden"><div class="d-flex align-items-center mb-1"><h6 class="text-truncate mb-0 me-auto">ChatGPT</h6></div><div class="text-truncate"><i class="zmdi zmdi-circle text-success"></i> Online </div></div></div></div></div></li>`);
      if (data_load.value) {
        _push(ssrRenderComponent(_component_el_skeleton, {
          rows: 5,
          animated: ""
        }, null, _parent));
      } else {
        _push(`<div${ssrRenderAttrs(mergeProps({
          class: "bot_info"
        }, ssrGetDirectiveProps(_ctx, _directive_loading, left_loding.value)))}><!--[-->`);
        ssrRenderList(unref(messages), (item, index) => {
          _push(`<li class="${ssrRenderClass([ms_active.value == item[item.length - 1].session_id ? "active" : "", "online"])}"><div class="hover_action"><button type="button" class="btn btn-link text-danger"><i class="zmdi zmdi-delete"></i></button></div><div class="card"><div class="card-body"><div class="media"><div class="avatar me-3"><span class="status rounded-circle"></span><img class="avatar rounded-circle"${ssrRenderAttr("src", _imports_0)} alt="avatar"></div><div class="media-body overflow-hidden"><div class="d-flex align-items-center mb-1"><h6 class="text-truncate mb-0 me-auto">${ssrInterpolate(item[item.length - 1].question)}</h6><p class="small text-muted text-nowrap ms-4 mb-0">${ssrInterpolate(item[item.length - 1].created_at)}</p></div><div class="text-truncate h-20">${item[item.length - 1].message.replace(/\n/g, "<br />")}</div></div></div></div></div></li>`);
        });
        _push(`<!--]--></div>`);
      }
      _push(`</ul>`);
      _push(ssrRenderComponent(_component_el_pagination, {
        "current-page": page.value,
        "page-size": limit.value,
        "pager-count": 4,
        background: "",
        layout: "prev, pager, next",
        total: ms_count.value,
        onCurrentChange: handleCurrentChange
      }, null, _parent));
      _push(`</div></div></div><div class="main px-3"><div${ssrRenderAttrs(mergeProps({
        class: "chat-body",
        id: "chatbody"
      }, ssrGetDirectiveProps(_ctx, _directive_loading, loadins.value)))}><div class="chat-header border-bottom py-xl-4 py-md-3 py-2"><div class="container-xxl"><div class="row align-items-center"><div class="col-6 col-xl-4 d-sm-flex"><button class="btn sidebar-toggle-btn"><i class="zmdi zmdi-menu"></i></button><div class="media">`);
      if (ms_active.value == 0) {
        _push(`<div class="avatar me-3"><div class="avatar rounded-circle no-image bg-primary text-light"><span><i class="zmdi zmdi-comment-text"></i></span></div></div>`);
      } else {
        _push(`<div class="me-3 show-user-detail"><span class="status rounded-circle"></span><img class="avatar rounded-circle"${ssrRenderAttr("src", _imports_0)} alt="avatar"></div>`);
      }
      _push(`<div class="media-body overflow-hidden"><div class="d-flex align-items-center mb-1">`);
      if (ms_active.value == 0) {
        _push(`<h6 class="text-truncate mb-0 me-auto">ChatGPT</h6>`);
      } else {
        _push(`<!---->`);
      }
      if (unref(me_message).length > 0) {
        _push(`<h6 class="text-truncate mb-0 me-auto">${ssrInterpolate(unref(me_message)[0].question)}</h6>`);
      } else {
        _push(`<!---->`);
      }
      _push(`</div><div class="text-truncate"><i class="zmdi zmdi-circle text-success"></i> Online </div></div></div></div><div class="col-6 col-xl-8 text-end"><ul class="nav justify-content-end align-items-center"><li class="nav-item list-inline-item d-none d-md-block me-2">`);
      _push(ssrRenderComponent(_component_client_only, null, {}, _parent));
      _push(`</li><li class="nav-item list-inline-item d-md-block me-2">`);
      _push(ssrRenderComponent(_component_client_only, null, {}, _parent));
      _push(`</li><li class="nav-item list-inline-item d-md-block">`);
      _push(ssrRenderComponent(_component_client_only, null, {}, _parent));
      _push(`</li></ul></div></div></div></div><div class="collapse" id="chat-search-div"><div class="container-xxl py-2"><div class="input-group"><input type="text" class="form-control" placeholder="Find messages in current conversation"><div class="input-group-append"><span class="input-group-text text-muted">0 / 0</span></div><div class="input-group-append"><button type="button" class="btn btn-secondary">Search</button><button type="button" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="sr-only">Toggle Dropdown</span></button><div class="dropdown-menu dropdown-menu-right shadow border-0"><a class="dropdown-item" href="#">Action</a><a class="dropdown-item" href="#">Another action</a><a class="dropdown-item" href="#">Something else here</a><div role="separator" class="dropdown-divider"></div><a class="dropdown-item" href="#">Separated link</a></div></div></div></div></div><div class="chat-content"><div class="container-xxl"><ul class="list-unstyled py-4">`);
      if (ms_active.value == 0) {
        _push(`<div class="bot_message_s"><li class="d-flex message"><div class="mr-lg-3 me-2"><div class="avatar sm rounded-circle bg-primary d-flex align-items-center justify-content-center"><span><i class="zmdi zmdi-comment-text text-light"></i></span></div></div><div class="message-body"><div class="message-row d-flex align-items-center"><div class="message-content p-3"> \u{1F64C} \u6B22\u8FCE\u56DE\u6765!<br> \u6709\u4EC0\u4E48\u53EF\u4EE5\u5E2E\u52A9\u60A8? </div></div><div class="message-row d-flex align-items-center"><div class="message-content p-3"> \u{1F44B} \u60A8\u597D\uFF0C\u6211\u662F\u60A8\u7684\u4E13\u5C5E\u673A\u5668\u4EBA.<br>\u5F53\u524D\u4F7F\u7528\u7684\u662FGPT3.5\u6A21\u578B. <br>\u5982\u679C\u4F60\u5BF9\u6211\u4EEC\u7684\u5DE5\u5177\u6709\u4EFB\u4F55\u7591\u95EE\uFF0C\u8BF7\u544A\u8BC9\u6211\u4EEC </div></div></div></li></div>`);
      } else {
        _push(`<!---->`);
      }
      _push(`<!--[-->`);
      ssrRenderList(unref(me_message), (item, index) => {
        _push(`<div class="message_s"><li class="d-flex message right"><div class="message-body"><span class="date-time text-muted">${ssrInterpolate(item.created_at)}<i class="zmdi zmdi-check-all text-primary"></i></span><div class="message-row d-flex align-items-center justify-content-end"><div class="message-content border p-3">${ssrInterpolate(item.question)}</div></div></div></li><li class="d-flex message"><div class="mr-lg-3 me-2"><img class="avatar sm rounded-circle"${ssrRenderAttr("src", _imports_0)} alt="avatar"></div><div class="message-body"><span class="date-time text-muted">${ssrInterpolate(item.created_at)}</span><div class="message-row d-flex align-items-center"><div class="${ssrRenderClass([index == unref(me_message).length - 1 && !is_done.value ? "ms-up" : "", "message-content p-3"])}">${renderMarkdown(item.message).replace(/\\n/g, "\n")}</div>`);
        _push(ssrRenderComponent(_component_el_dropdown, null, {
          dropdown: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(ssrRenderComponent(_component_el_dropdown_menu, null, {
                default: withCtx((_2, _push3, _parent3, _scopeId2) => {
                  if (_push3) {
                    _push3(ssrRenderComponent(_component_el_dropdown_item, {
                      command: "copy",
                      onClick: ($event) => handleClick(item.message.replace(/\n/g, "<br />"))
                    }, {
                      default: withCtx((_3, _push4, _parent4, _scopeId3) => {
                        if (_push4) {
                          _push4(`\u590D\u5236\u7B54\u6848`);
                        } else {
                          return [createTextVNode("\u590D\u5236\u7B54\u6848")];
                        }
                      }),
                      _: 2
                    }, _parent3, _scopeId2));
                  } else {
                    return [createVNode(_component_el_dropdown_item, {
                      command: "copy",
                      onClick: ($event) => handleClick(item.message.replace(/\n/g, "<br />"))
                    }, {
                      default: withCtx(() => [createTextVNode("\u590D\u5236\u7B54\u6848")]),
                      _: 2
                    }, 1032, ["onClick"])];
                  }
                }),
                _: 2
              }, _parent2, _scopeId));
            } else {
              return [createVNode(_component_el_dropdown_menu, null, {
                default: withCtx(() => [createVNode(_component_el_dropdown_item, {
                  command: "copy",
                  onClick: ($event) => handleClick(item.message.replace(/\n/g, "<br />"))
                }, {
                  default: withCtx(() => [createTextVNode("\u590D\u5236\u7B54\u6848")]),
                  _: 2
                }, 1032, ["onClick"])]),
                _: 2
              }, 1024)];
            }
          }),
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(`<div class="dropdown"${_scopeId}><a class="text-muted ms-1 p-2 text-muted" href="javascript:;" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"${_scopeId}><i class="zmdi zmdi-more-vert"${_scopeId}></i></a></div>`);
            } else {
              return [createVNode("div", {
                class: "dropdown"
              }, [createVNode("a", {
                class: "text-muted ms-1 p-2 text-muted",
                href: "javascript:;",
                "data-toggle": "dropdown",
                "aria-haspopup": "true",
                "aria-expanded": "false"
              }, [createVNode("i", {
                class: "zmdi zmdi-more-vert"
              })])])];
            }
          }),
          _: 2
        }, _parent));
        _push(`</div></div></li></div>`);
      });
      _push(`<!--]--></ul></div></div><div class="chat-footer border-top py-xl-4 py-lg-2 py-2"><div class="container-xxl"><div class="row"><div class="col-12">`);
      _push(ssrRenderComponent(_component_el_form, {
        ref_key: "ruleFormRef",
        ref: ruleFormRef,
        model: unref(ruleForm),
        rules: unref(rules),
        class: "demo-ruleForm",
        "status-icon": ""
      }, {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(`<div class="col-9 d-inline-block"${_scopeId}>`);
            _push2(ssrRenderComponent(_component_el_form_item, {
              prop: "message_input"
            }, {
              default: withCtx((_2, _push3, _parent3, _scopeId2) => {
                if (_push3) {
                  _push3(ssrRenderComponent(_component_el_input, {
                    size: "large",
                    disabled: send_loading.value,
                    class: "form-control border-0 pl-0",
                    modelValue: unref(ruleForm).message_input,
                    "onUpdate:modelValue": ($event) => unref(ruleForm).message_input = $event,
                    autocomplete: "off",
                    placeholder: "\u8BF7\u8F93\u5165\u63D0\u95EE\u5185\u5BB9",
                    onKeydown: ($event) => submitForm(ruleFormRef.value)
                  }, null, _parent3, _scopeId2));
                } else {
                  return [createVNode(_component_el_input, {
                    size: "large",
                    disabled: send_loading.value,
                    class: "form-control border-0 pl-0",
                    modelValue: unref(ruleForm).message_input,
                    "onUpdate:modelValue": ($event) => unref(ruleForm).message_input = $event,
                    autocomplete: "off",
                    placeholder: "\u8BF7\u8F93\u5165\u63D0\u95EE\u5185\u5BB9",
                    onKeydown: withKeys(($event) => submitForm(ruleFormRef.value), ["enter", "native"])
                  }, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "onKeydown"])];
                }
              }),
              _: 1
            }, _parent2, _scopeId));
            _push2(ssrRenderComponent(_component_el_form_item, {
              style: {
                "margin-bottom": "0",
                "display": "none"
              }
            }, {
              default: withCtx((_2, _push3, _parent3, _scopeId2) => {
                if (_push3) {
                  _push3(ssrRenderComponent(_component_el_input, null, null, _parent3, _scopeId2));
                } else {
                  return [createVNode(_component_el_input)];
                }
              }),
              _: 1
            }, _parent2, _scopeId));
            _push2(`</div><div class="col-3 d-inline-block div-pad"${_scopeId}>`);
            _push2(ssrRenderComponent(_component_el_form_item, null, {
              default: withCtx((_2, _push3, _parent3, _scopeId2) => {
                if (_push3) {
                  _push3(ssrRenderComponent(_component_el_button, {
                    size: "large",
                    type: "primary",
                    onClick: ($event) => submitForm(ruleFormRef.value),
                    loading: send_loading.value
                  }, {
                    default: withCtx((_3, _push4, _parent4, _scopeId3) => {
                      if (_push4) {
                        _push4(`<span class="me-2"${_scopeId3}> \u53D1\u9001 </span><i class="zmdi zmdi-mail-send"${_scopeId3}></i>`);
                      } else {
                        return [createVNode("span", {
                          class: "me-2"
                        }, " \u53D1\u9001 "), createVNode("i", {
                          class: "zmdi zmdi-mail-send"
                        })];
                      }
                    }),
                    _: 1
                  }, _parent3, _scopeId2));
                } else {
                  return [createVNode(_component_el_button, {
                    size: "large",
                    type: "primary",
                    onClick: ($event) => submitForm(ruleFormRef.value),
                    loading: send_loading.value
                  }, {
                    default: withCtx(() => [createVNode("span", {
                      class: "me-2"
                    }, " \u53D1\u9001 "), createVNode("i", {
                      class: "zmdi zmdi-mail-send"
                    })]),
                    _: 1
                  }, 8, ["onClick", "loading"])];
                }
              }),
              _: 1
            }, _parent2, _scopeId));
            _push2(`</div>`);
          } else {
            return [createVNode("div", {
              class: "col-9 d-inline-block"
            }, [createVNode(_component_el_form_item, {
              prop: "message_input"
            }, {
              default: withCtx(() => [createVNode(_component_el_input, {
                size: "large",
                disabled: send_loading.value,
                class: "form-control border-0 pl-0",
                modelValue: unref(ruleForm).message_input,
                "onUpdate:modelValue": ($event) => unref(ruleForm).message_input = $event,
                autocomplete: "off",
                placeholder: "\u8BF7\u8F93\u5165\u63D0\u95EE\u5185\u5BB9",
                onKeydown: withKeys(($event) => submitForm(ruleFormRef.value), ["enter", "native"])
              }, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "onKeydown"])]),
              _: 1
            }), createVNode(_component_el_form_item, {
              style: {
                "margin-bottom": "0",
                "display": "none"
              }
            }, {
              default: withCtx(() => [createVNode(_component_el_input)]),
              _: 1
            })]), createVNode("div", {
              class: "col-3 d-inline-block div-pad"
            }, [createVNode(_component_el_form_item, null, {
              default: withCtx(() => [createVNode(_component_el_button, {
                size: "large",
                type: "primary",
                onClick: ($event) => submitForm(ruleFormRef.value),
                loading: send_loading.value
              }, {
                default: withCtx(() => [createVNode("span", {
                  class: "me-2"
                }, " \u53D1\u9001 "), createVNode("i", {
                  class: "zmdi zmdi-mail-send"
                })]),
                _: 1
              }, 8, ["onClick", "loading"])]),
              _: 1
            })])];
          }
        }),
        _: 1
      }, _parent));
      _push(`</div></div></div></div></div><div class="user-detail-sidebar py-xl-4 py-3 px-xl-4 px-3"><div class="d-flex flex-column"><div class="header border-bottom pb-4 d-flex justify-content-between"><div><h6 class="mb-0 font-weight-bold">User Details</h6><span class="text-muted">Update your profile details</span></div><div><button class="btn btn-link text-muted close-chat-sidebar" type="button"><i class="zmdi zmdi-close"></i></button></div></div><div class="body mt-4"><div class="d-flex justify-content-center"><div class="avatar xxl"><img class="avatar xxl rounded-circle"${ssrRenderAttr("src", _imports_1)} alt="avatar"></div></div><div class="text-center mt-3 mb-5"><h4>Jason Porter</h4><span class="text-muted"><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0f62666c676a63636a21687d6a6a614f68626e6663216c6062">[email\xA0protected]</a></span><p>+14 123 456 789 - New york (USA)</p></div><ul class="chat-list"><li class="header d-flex justify-content-between ps-3 pe-3 mb-1"><span>mutual friend</span></li><li><a href="#" class="card"><div class="card-body"><div class="media"><div class="avatar me-3"><img class="avatar rounded-circle"${ssrRenderAttr("src", _imports_2)} alt="avatar"></div><div class="media-body overflow-hidden"><div class="d-flex align-items-center mb-1"><h6 class="text-truncate mb-0 me-auto">Michelle Green</h6></div><div class="text-truncate">+14 123 456 258</div></div></div></div></a></li><li><a href="#" class="card"><div class="card-body"><div class="media"><div class="avatar me-3"><img class="avatar rounded-circle"${ssrRenderAttr("src", _imports_3)} alt="avatar"></div><div class="media-body overflow-hidden"><div class="d-flex align-items-center mb-1"><h6 class="text-truncate mb-0 me-auto">Jason Porter</h6></div><div class="text-truncate">+14 123 456 963</div></div></div></div></a></li><li><a href="#" class="card"><div class="card-body"><div class="media"><div class="avatar me-3"><img class="avatar rounded-circle"${ssrRenderAttr("src", _imports_4)} alt="avatar"></div><div class="media-body overflow-hidden"><div class="d-flex align-items-center mb-1"><h6 class="text-truncate mb-0 me-auto">Elizabeth Martin</h6></div><div class="text-truncate">+14 123 456 753</div></div></div></div></a></li></ul></div></div></div><div class="addnew-user-sidebar py-xl-4 py-3 px-xl-4 px-3"><div class="d-flex flex-column"><div class="header border-bottom pb-4 d-flex justify-content-between"><div><h6 class="mb-0 font-weight-bold">Add new member</h6><span class="text-muted">Update your profile details</span></div><div><button class="btn btn-link text-muted close-chat-sidebar" type="button"><i class="zmdi zmdi-close"></i></button></div></div><div class="body mt-4"><div class="form-group input-group-lg search mb-3"><i class="zmdi zmdi-search"></i><input type="text" class="form-control" placeholder="Search..."></div><ul class="chat-list"><li class="header d-flex justify-content-between ps-3 pe-3 mb-1"><span>A</span><div class="dropdown"><a class="btn btn-link px-1 py-0 border-0 text-muted dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></a><div class="dropdown-menu dropdown-menu-right"><a class="dropdown-item" href="#">Action</a><a class="dropdown-item" href="#">Another action</a><a class="dropdown-item" href="#">Something else here</a></div></div></li><li><div class="hover_action"><button type="button" class="btn btn-link text-info"><i class="zmdi zmdi-plus-circle"></i></button></div><a href="#" class="card"><div class="card-body"><div class="media"><div class="avatar me-3"><img class="avatar rounded-circle"${ssrRenderAttr("src", _imports_2)} alt="avatar"></div><div class="media-body overflow-hidden"><div class="d-flex align-items-center mb-1"><h6 class="text-truncate mb-0 me-auto">Amelia Green</h6></div><div class="text-truncate"> last seen 2 hours ago </div></div></div></div></a></li><li><div class="hover_action"><button type="button" class="btn btn-link text-info"><i class="zmdi zmdi-plus-circle"></i></button></div><a href="#" class="card"><div class="card-body"><div class="media"><div class="avatar me-3"><img class="avatar rounded-circle"${ssrRenderAttr("src", _imports_4)} alt="avatar"></div><div class="media-body overflow-hidden"><div class="d-flex align-items-center mb-1"><h6 class="text-truncate mb-0 me-auto">Ava Green</h6></div><div class="text-truncate"> last seen 1 hours ago </div></div></div></div></a></li><li class="header d-flex justify-content-between ps-3 pe-3 mb-1"><span>C</span></li><li><div class="hover_action"><button type="button" class="btn btn-link text-info"><i class="zmdi zmdi-plus-circle"></i></button></div><a href="#" class="card"><div class="card-body"><div class="media"><div class="avatar me-3"><img class="avatar rounded-circle"${ssrRenderAttr("src", _imports_5)} alt="avatar"></div><div class="media-body overflow-hidden"><div class="d-flex align-items-center mb-1"><h6 class="text-truncate mb-0 me-auto">Charlotte Green</h6></div><div class="text-truncate"> last seen 6 hours ago </div></div></div></div></a></li><li><div class="hover_action"><button type="button" class="btn btn-link text-info"><i class="zmdi zmdi-plus-circle"></i></button></div><a href="#" class="card"><div class="card-body"><div class="media"><div class="avatar me-3"><img class="avatar rounded-circle"${ssrRenderAttr("src", _imports_0)} alt="avatar"></div><div class="media-body overflow-hidden"><div class="d-flex align-items-center mb-1"><h6 class="text-truncate mb-0 me-auto">Chloe Green</h6></div><div class="text-truncate"> last seen 3 hours ago </div></div></div></div></a></li><li><div class="hover_action"><button type="button" class="btn btn-link text-info"><i class="zmdi zmdi-plus-circle"></i></button></div><a href="#" class="card"><div class="card-body"><div class="media"><div class="avatar me-3"><img class="avatar rounded-circle"${ssrRenderAttr("src", _imports_6)} alt="avatar"></div><div class="media-body overflow-hidden"><div class="d-flex align-items-center mb-1"><h6 class="text-truncate mb-0 me-auto">Charles Green</h6></div><div class="text-truncate"> last seen 2 hours ago </div></div></div></div></a></li><li class="header d-flex justify-content-between ps-3 pe-3 mb-1"><span>D</span></li><li><div class="hover_action"><button type="button" class="btn btn-link text-info"><i class="zmdi zmdi-plus-circle"></i></button></div><a href="#" class="card"><div class="card-body"><div class="media"><div class="avatar me-3"><img class="avatar rounded-circle"${ssrRenderAttr("src", _imports_5)} alt="avatar"></div><div class="media-body overflow-hidden"><div class="d-flex align-items-center mb-1"><h6 class="text-truncate mb-0 me-auto">David Green</h6></div><div class="text-truncate"> last seen 6 hours ago </div></div></div></div></a></li><li class="header d-flex justify-content-between ps-3 pe-3 mb-1"><span>M</span></li><li><div class="hover_action"><button type="button" class="btn btn-link text-info"><i class="zmdi zmdi-plus-circle"></i></button></div><a href="#" class="card"><div class="card-body"><div class="media"><div class="avatar me-3"><img class="avatar rounded-circle"${ssrRenderAttr("src", _imports_7)} alt="avatar"></div><div class="media-body overflow-hidden"><div class="d-flex align-items-center mb-1"><h6 class="text-truncate mb-0 me-auto">Michael Green</h6></div><div class="text-truncate"> last seen 6 hours ago </div></div></div></div></a></li><li><div class="hover_action"><button type="button" class="btn btn-link text-info"><i class="zmdi zmdi-plus-circle"></i></button></div><a href="#" class="card"><div class="card-body"><div class="media"><div class="avatar me-3"><img class="avatar rounded-circle"${ssrRenderAttr("src", _imports_7)} alt="avatar"></div><div class="media-body overflow-hidden"><div class="d-flex align-items-center mb-1"><h6 class="text-truncate mb-0 me-auto">Mohammad</h6></div><div class="text-truncate"> last seen 6 hours ago </div></div></div></div></a></li><li class="header d-flex justify-content-between ps-3 pe-3 mb-1"><span>T</span></li><li><div class="hover_action"><button type="button" class="btn btn-link text-info"><i class="zmdi zmdi-plus-circle"></i></button></div><a href="#" class="card"><div class="card-body"><div class="media"><div class="avatar me-3"><img class="avatar rounded-circle"${ssrRenderAttr("src", _imports_8)} alt="avatar"></div><div class="media-body overflow-hidden"><div class="d-flex align-items-center mb-1"><h6 class="text-truncate mb-0 me-auto">Tommy Green</h6></div><div class="text-truncate"> last seen 6 hours ago </div></div></div></div></a></li></ul></div></div></div></div>`);
      _push(ssrRenderComponent(_component_client_only, null, {}, _parent));
      _push(`<!--]-->`);
    };
  }
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/index.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};

export { _sfc_main as default };
//# sourceMappingURL=index-f206e9bb.mjs.map
